package top.revery.task.dto;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import top.revery.api.entity.user.BaseCompanyUser;
import top.revery.api.entity.user.BaseUserKol;

import java.util.List;

/**
 * @author denghao
 * @title
 * @package
 * @date 2019/12/13 9:27
 */
public interface CompanyDto  extends JpaRepository<BaseCompanyUser,Long> ,JpaSpecificationExecutor<BaseCompanyUser> {
    BaseUserKol findByTelephone(String telephone);

    BaseUserKol findByEmail(String email);

    @Query("select  u.id ,u.companyName from  BaseCompanyUser u where u.companyName like CONCAT('%',:name,'%') ")
    List<BaseCompanyUser> findByNameLike(@Param("name")String name);
}
